Auto Scaling
💡 Definition
AWS Auto Scaling helps you maintain application availability and allows you to automatically scale your EC2 capacity up or down according to conditions you define. It ensures that you have the correct number of EC2 instances available to handle the load for your application.
🔑 Key Concepts
- Launch Configuration/Template: Defines the EC2 instance (AMI, instance type, key pair, Security Groups, storage) that an Auto Scaling group will launch.
- Auto Scaling Group (ASG): A collection of EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management.
- Scaling Policies:
- Simple Scaling: Adjusts capacity based on CloudWatch alarm.
- Step Scaling: Adjusts capacity based on specific step adjustments.
- Target Tracking Scaling: Aims for a target value for a metric (e.g., keep CPU utilization at 70%).
- Scheduled Scaling: Scales based on a predictable schedule (e.g., increase capacity before peak hours).
- Health Checks: Auto Scaling can replace unhealthy instances.
⚙️ How it Works
- Define ASG: Specify min/max/desired capacity, AZs, and launch template.
- Set Scaling Policies: Link to CloudWatch metrics (e.g., CPU utilization).
- Monitor: Auto Scaling monitors the metrics and adjusts the number of instances as needed.
🎯 Use Cases
- Handle Variable Load: Automatically add or remove EC2 instances based on demand fluctuations.
- Maintain Availability: Replace unhealthy instances to ensure continuous application performance.
- Cost Optimization: Scale down during off-peak hours to save costs.
💰 Pricing Model
- AWS Auto Scaling is free. You only pay for the AWS resources (e.g., EC2 instances, CloudWatch alarms) that are launched or used by Auto Scaling.
📝 Exam Tips (CLF-C02)
- High Availability and Fault Tolerance are key benefits.
- Integrates with Load Balancers to distribute traffic across instances.
- Works closely with CloudWatch alarms to trigger scaling actions.
- Helps achieve Cost Optimization by scaling down.
See Also: * EC2 * Load Balancer * CloudWatch